package org.example.petitionplatformsystem.dao;

import io.lettuce.core.dynamic.annotation.Param;
import org.example.petitionplatformsystem.dao.model.ComplaintStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ComplaintStatusRepository extends JpaRepository<ComplaintStatus, Long> {
    @Query("SELECT cs.status FROM ComplaintStatus cs WHERE cs.eventID = :eventID ORDER BY cs.updateTime DESC")
    List<Integer> findReplyContentByEventIDOrderByUpdateTimeDesc(@Param("eventID") Long eventID);
    @Query("SELECT cs.updateTime FROM ComplaintStatus cs WHERE cs.eventID = :eventID ORDER BY cs.updateTime DESC")
    List<String> findUpdateTimeByEventIDOrderByUpdateTimeDesc(@Param("eventID") Long eventID);
}
